// dlg.txt

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 14;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You enter a ruin painstakingly burrowed into the side of the mountain. You can't tell how old this place is. Very old. It's been abandoned for at least a century.";
	text2 = "A nearby sign identifies this place as Southern Erudico. The Rokaj is a wild and violent place, but it also values learning. Especially learning of an explosive variety. You can sense the energy in the air, and the smell of alchemy still hangs in the air.";
	text3 = "This is a magical workshop. Long abandoned, and not properly secured. A constant problem in the less-responsible vassal states.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "When this facility was abandoned, most of the books and scrolls were carried away, leaving long rows of empty shelves. Only a few works remain. All that you can see here rotted into illegibility a long time ago.";
	text2 = "The library is eerily quiet, and spider webs are everywhere. Thick, fresh, sticky, ropy webs. Some of them still hold fresh rats. Sometimes threats are hidden. And sometimes they are loudly advertised.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "This cavern is painfully hot and humid, and the air is choked with sulfur and ash. This academy was built, unsurprisingly, on a volcanic vent. The natural heat was used for dramatic metalwork.";
	text2 = "Weirdly, under the smoke, you can also smell the remnants of alchemical experiments. The Erudico weren't mad enough to do alchemy this close to a forge, were they? They're lucky they didn't blow this whole mountain up.";
	text3 = "Or maybe they've been intermittently blowing mountains up for millennia.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You enter a long stone hall. Pairs of closed gates to either side block off cells. This is where the Erudico stored beasts. Some captured for study. Some made by them.";
	text2 = "After all these years, you would think everyone here was dead. Yet, you can smell rank sweat and hear low growls. They must have abandoned some magical beasts here, left to spend a century being driven mad by solitude and hunger. Great.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "You are completely unsurprised to see movement out of the corners of your eyes. Huge spiders folded themselves up in the shadowy spaces over the bookshelves.";
	text2 = "Now they are emerging, ready to ambush fresh prey. They are too dumb to realize that you are prepared for them.";
	code =
		sf(this_town,5,1);
		activate_hidden_group(2);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0 && gf(14,21) > 0 && gf(14,22) > 0;
	text1 = "Now that the gates to the north and south are open, you have cleared a path through these ruins. This road is open for the first time in a century. It's not very valuable for you, but some smugglers are sure to be delighted.";
	text2 = "(Opening gates between provinces makes traveling using the World Map slightly faster.)";
	code =
		sf(this_town,6,1);
		award_party_xp(50);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "This was once a common room, where the Eruds came to rest, play games, and relax when not engaging in dangerous and unpredictable experiments. Most of their amusements have rotted away.";
	text2 = "There is a closed gate to the north. Interestingly, there is a pedestal next to it. There are no levers, wheels, or other controls. There are, however, bowls of colored stones on the pedestal. Some stones have already been set into its surface.";
	code =
		sf(this_town,7,1);
	break;


begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "The box is full of the abandoned refuse of the workshop. Broken flasks. Scraps of parchment. A skull.";
	text2 = "There is also a single book, bound in sturdy leather. This chest managed to keep it intact all of these years. It is called 'Erudico Principles'. You take it. Some Havenite is sure to want to study the ways of the Ro.";
	code =
		if (gf(14,13) == 0) {
			sf(14,13,1);
			set_spec_item(30,1);
			}
			else rs(2);
	break;

begintalknode;
	tag = 14;
	condition = 1;
	text1 = "This cave was being used to breed strange, twisted plants. They are long dead. The pots are full of crumbling and rotted vines.";
	text2 = "Yet, they are still tended to by one lonely shade. When you come into view, it lets out a banshee screech. _You will not steal my secrets!_";

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "The banshee screeches, _Pets! Come, my pets!_ You hear a rustling sound, coming from small holes in the base of the walls. Some of the ghost creations managed to survive all these years. And breed.";

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "The shade falls to bits with one final scream. The sense of malevolent magic in this part of the laboratory fades. It will no longer draw horrible creatures to it.";
	text2 = "There may still be monsters in other wings of the ruin. It will take some effort to reach those areas, though. A lot of the corridors are blocked by cave-ins.";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "The wheel refuses to turn. Its mechanism must be broken.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "The box is full of old books and scrolls. A cache of research notes and papers, ready to be spread among the Erudico of the Ro. They were forgotten here when these halls were abandoned.";
	text2 = "You pick out the ones that are still readable. Some member of the Erudico in the Gentle Coast might be interested.";
	text3 = "None of the remaining works are useful.";
	code =
		if (gf(14,12) == 0) {
			sf(14,12,1);
			set_spec_item(29,1);
			rs(3);
			}
			else rs(2);
	break;

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "When you reach the center of the hall, the gate you entered through slams shut. It is some sort of malevolent defense system. You suddenly suspect how the old Erudico planned to keep their monsters fed in their absence.";
	text2 = "You hear the grinding of steel chains over steel. The ground vibrates slowly under your feet. The gates are starting to open.";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "The final set of gates opens. The western gates rise, giving you a way to escape from this trap.";
	text2 = "You shake your head at the irresponsibility of the old Erudico. These sorts of horrors should never have been left uncontrolled. This is the sort of thing Haven's laws were meant to prevent. Yet, Haven ruled the Rokaj when this place was left. It shows how seriously your vassal doesn't take you.";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "This box is long, narrow, and lined with velvet. It was designed to hold a massive sword.";
	text2 = "The blade it contains is a remarkable trophy. A mighty two-hander. The strange metal reflects the light in little rainbows, like a prism. When you look at the sword, you think you can smell and hear the sea. It bears a strange enchantment.";
	text3 = "It is an impressive weapon. However, it is also worn and chipped. It would have to be repaired to regain its full power, but what smith in the Rokaj is skilled enough? Anyway, you loot it.";
	code =
		if (gf(14,18) == 0) {
			sf(14,18,1);
			reward_give(585);
			}
			else {
				rs(2); rs(3); }
	break;

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

////

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				